<template>
    <div class="goods">
        <div class="goodsHeader">
            <slot name="title">默认标题</slot>
        </div>
        <div class="goodsbox">
            <router-link :to="`/info/${item.goodsId}`" v-for="item in dataItem" :key="item.goodsId">
                <div class="img_box">
                    <img :src="item.goodsCoverImg" :alt="item.goodsCoverImg">
                </div>
                <div class="good-desc">
                    <div class="title">{{item.goodsName}}</div>
                    <div class="price">￥{{item.sellingPrice}}</div>
                </div>
            </router-link>
        </div>
    </div>
</template>
<script setup>
import { defineProps } from 'vue';
defineProps({
    dataItem:{
        type:Array,
        default:[]
    }
})
</script>
<style scoped>
.goodsHeader {
    height: 80px;
    color: #1BAEAE;
    background-color: #f3f2f2;
    line-height: 80px;
    text-align: center;
    font-size: 26px;
    font-weight: bold;
}
.goodsbox {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}
a {
    text-decoration: none;
    display: inline-block;
    width: 50%;
    border-bottom:1px solid #ccc ;
    text-align: center;
    padding: 30px;
    box-sizing: border-box;
    color: #000;
}
a:nth-child(2n-1) {
    border-right:1px solid #ccc ;
}
a img {
    width: 60%;
}
.good-desc {
    margin-top: 20px;
}
.good-desc .title {
    font-size: 20px;
    color: #000;
    font-weight: 500;
}
.good-desc .price {
    color: #1BAEAE;
    font-weight: 500;
    font-size: 20px;
}
</style>